<template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="选择规则" prop="drugRuleId">
        <el-input v-model="formData.drugRuleId" placeholder="请输入选择规则" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="内容" prop="content">
        <el-input v-model="formData.content" type="textarea" placeholder="请输入内容"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="语义" prop="semanteme">
        <el-input v-model="formData.semanteme" type="textarea" placeholder="请输入语义"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="校验结果" prop="verifyResult">
        {{verifyResult}}
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
import { verify } from "@/api/system/verify";
export default {
  components: {},
  props: [],
  data() {
    return {
      verifyResult:undefined,
      formData: {
        drugRuleId: undefined,
        content: undefined,
        semanteme: undefined,
      },
      rules: {
        drugRuleId: [{
          required: true,
          message: '请输入选择规则',
          trigger: 'blur'
        }],
        content: [{
          required: false,
          message: '请输入内容',
          trigger: 'blur'
        }],
        semanteme: [{
          required: false,
          message: '请输入语义',
          trigger: 'blur'
        }],
      },
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单

        verify(this.formData).then(response => {
        if (response.code === 200) {
          this.verifyResult = response.data;
          this.msgSuccess("校验结果:"+response.data);
        }
      });
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
